<?php
ob_start();
session_start();
$id_member = $_SESSION["id_member"];
?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Adinop Co., Ltd. was founded as an ingredients importer and local manufacturers’ distributor in 1986. We also function as an exporter of finished products</title>
        <link rel="stylesheet" href="../css/style.css"/>
        <script type="text/javascript" src="../js/jquery/jquery-latest.min.js"></script>
        <link type="text/css" href="../css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
        <script src="../js/jquery/jquery-1.4.3.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="../js/jquery/jquery-ui-1.7.2.custom.min.js"></script>
        <script type="text/javascript" src="../js/jquery/timepicker.js"></script>
    </head>

    <script type="text/javascript">
        $(function() {
            $('#stWarunty').datepicker({
                duration: '',
                constrainInput: false
            });
        });

        $(function() {
            $('#enWarunty').datepicker({
                duration: '',
                constrainInput: false
            });
        });

    </script>


    <body>
        <div align="center">
            <?php
            include_once "../connect.php";
            $pd_id = $_GET["pd_id"];
            if (!empty($pd_id)) {
                $sql = "SELECT  *  FROM product_detail LEFT  JOIN product ON product_detail.prd_id = product.prd_id WHERE product_detail.pd_id = '$pd_id'
                                            ";
                $rs = mysql_query($sql);
                if ($rs) {
                    $r = mysql_fetch_array($rs);
                } else {
                    echo mysql_error();
                }
            }
            ?>        
            <fieldset>
                <legend class="nameTitle">แก้ไขรายละเอียดอุปกรณ์</legend>
                <form
                    method="POST"
                    action="ProductDeEdit_Save.php"
                    enctype="multipart/form-data"
                    name ="frmMain" id="frmMain" OnSubmit="return CheckValidate();" />
                <table class="inputcontenttable"><br />

                    <tr align="left">
                        <td align="left">ชื่ออุปกรณ์</td> 
                        <td><input  name="pd_name" type="text" value="<?= $r[pd_name] ?>" /></td>
                        <td></td>
                        <td>รหัสทรัย์สิน</td>
                        <td><input  name="pd_codeAdinop" type="text" value="<?= $r[pd_codeAdinop] ?>"/></td>
                    </tr>
                    <tr valign="top" >
                        <td>รหัสสินค้า</td>
                        <td><input  name="pd_code" type="text"  value="<?= $r[pd_code] ?>" readonly/></td>      
                        <td width="50px"></td>
                        <td>รหัสพนักงาน</td>
                        <td><input name="emp_id" type="text"  value="<?= $r[emp_id] ?>" readonly/></td>                          
                    </tr>
                    <tr valign="top">
                    </tr>
                    <tr valign="top">
                        <td>สถานะ</td>
                        <td><input name="pd_status" type="text"  value="<?= $r['pd_status'] ?>" readonly/></td>    
                        <td width="50px"></td>
                        <td>วันที่เบิก</td>
                        <td><input   name="pd_outDate" type="text" value="<?= $r[pd_outDate] ?>" readonly/></td>                          
                    </tr> 
                    <tr valign="top" >
                        <td>เริ่มประกัน</td>
                        <td><input id="stWarunty" name="pd_stWarunty" type="text" value="<?= $r[pd_stWarunty] ?>" /></td>    
                        <td width="50px"></td>
                        <td>สิ้นสุดประกัน</td>
                        <td><input id="enWarunty"  name="pd_enWarunty" type="text" value="<?= $r[pd_enWarunty] ?>" /></td>                          
                    </tr>
                    <tr valign="top" >
                        <tr>
                            <td>หมายเหตุ</td>
                            <td colspan="4"><textarea id="txtError" rows="4" cols="50" name="txtmainten" style="width: 445px"><?= $r[pd_remark] ?></textarea></td> 

                            <tr>
                                <td colspan="5" align="center"><input type="submit" name="Submit" value="Save" style="height: 30px; width: 120px" /></td>
                            </tr>
                            </table>           
                            <input name="pd_id" type="hidden" value="<?= $pd_id ?>"/>
                            </form>
                            </fieldset>
                            </div>
                            </body>
                            </html>


